]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panelMenu: Fix exception when destroying menuless button
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 26 Oct 2012 10:34:45 +0000 (12:34 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 26 Oct 2012 13:49:26 +0000 (15:49 +0200)
There's explicit API to create PanelMenu.Buttons with no menu, so
guard against this case in destroy().

https://bugzilla.gnome.org/show_bug.cgi?id=686763

js/ui/panelMenu.js

index 939abbb486cfb62ec65db9714c42302e34a49959..bdfa465d39f5c39267fe6783d7fb4d2d9fb1408a 100644 (file)
@@ -214,7 +214,8 @@ const Button = new Lang.Class({
     destroy: function() {
         this.actor._delegate = null;
 
-        this.menu.destroy();
+        if (this.menu)
+            this.menu.destroy();
         this.actor.destroy();
 
         this.emit('destroy');